import React, { useEffect, useState } from 'react'
import styles from './history.module.scss'
import { Image } from 'react-vant'
import { NavLink, useNavigate } from 'react-router-dom'
import http from '../../../http'
import { Empty, Button,NavBar,Toast  } from 'react-vant';
export default function History() {
  const naviagte=useNavigate()
   const [HistoryAksList,setHistoryAksList]=useState([])
  //获取历史问诊数据
  useEffect(()=>{
   http.get('health/user/inquiry/verify/v1/findHistoryInquiryRecord',{params:{page:1,count:5}}).then((res:any)=>{
    setHistoryAksList(res.result);
   })
  },[])
  return (
    <div className='box'>
       <NavBar
      title="历史问诊"
      onClickLeft={() =>naviagte('/my')}
    />
      {
        // 判断数据是否为空
        HistoryAksList.length>0?
        <div>
            <Empty description="暂无历史问诊数据">
      <Button style={{ width: 160 }} round type="primary" onClick={()=>naviagte('/my')}>
        点击返回
      </Button>
    </Empty>
        </div>:
        <div>

        </div>
      }
    </div>
  );
}
